1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method, apparatus, and computer instructions for generating instructions to optimize execution of a program.
2. Description of Related Art
In executing computer programs, the speed at which a program can be executed is often an important feature or benchmark. A number of different techniques are used to improve the efficiency at which instructions in a program are executed. One technique involves issuing multiple instructions per cycle to increase parallel processing by a processor. Another technique involves using a single-instruction, multiple-data (SIMD) design in which the processor performs the same operation on multiple sets of data operands using a single instruction. For example, a processor with SIMD support can treat data in long registers as multiple smaller words on which it performs the same operation and generates multiple independent outputs. In this example, the long registers may be 64 bit registers with the smaller words being four 16 bit words, or other sizes. Where the data sizes involved are smaller than the size of a register or smaller than the maximum size of a memory-to-memory instruction, the program will usually run faster if the compiler optimizer merges or widens these multiple “narrow” operations into a smaller number of “wide” operations.
Producing SIMD instructions automatically during optimization is often called “AutoSIMDization” or “Short Vector AutoSIMDization”. The optimizer must choose an acceptable and preferably optimal new sequence of instructions to do this, and one aspect of that is to choose what kind of registers and/or instruction category to use. There are various criteria and issues, depending on the computer architecture the program will execute on. The decisions can be complicated, especially for optimizers designed to handle programs for more than one architecture or for machine families with optional features.
Therefore, it would be advantageous to have an improved method, apparatus, and computer instructions for generating instructions to execute a program.